#pragma once
#include "Base/Log/Logger.h"

extern Logger g_LOGGER_MoheServer;

#define INIT_LOG(_logName, _fileName, _logLevel) \
	LOGNAME(_logName).init(_fileName); \
	LOGNAME(_logName).setLogLevel(_logLevel);

#define WRITELOG(_logger, _type, _format, ...)  _logger.writeCache(_type, _format, ## __VA_ARGS__)
#define WRITEDISK(_logger, _type, _format, ...)  _logger.writeDisk(_type, _format, ## __VA_ARGS__)

#define LOGNAME(_name) g_LOGGER_##_name

#define LOGI(_format, ...)  g_LOGGER_MoheServer.writeCache(LOG_INFO, _format, ## __VA_ARGS__)
#define LOGW(_format, ...)  g_LOGGER_MoheServer.writeCache(LOG_WARN, _format, ## __VA_ARGS__)
#define LOGE(_format, ...)  g_LOGGER_MoheServer.writeCache(LOG_ERROR, _format, ## __VA_ARGS__)
#define LOGD(_format, ...)  g_LOGGER_MoheServer.writeCache(LOG_DEBUG, _format, ## __VA_ARGS__)
